package com.shopmall.service;

import com.shopmall.mapper.BuyListMapper;
import com.shopmall.pojo.BuyList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class BuyListServiceImpl implements BuyListService{
    @Autowired
    BuyListMapper buyListMapper;

    @Override
    public List<BuyList> queryBuyListList(){
        return  buyListMapper.queryBuyListList();
    }

    @Override
    public List<BuyList> queryBuyListListEnd(){
        return  buyListMapper.queryBuyListListEnd();
    }

    @Override
    public BuyList queryBuyListById(int id){
        return buyListMapper.queryBuyListById(id);
    }

    @Override
    public List<BuyList> queryBuyListByUsername(String username){
        return buyListMapper.queryBuyListByUsername(username);
    }

    @Override
    public List<BuyList> queryBuyListEndByUsername(String username){
        return buyListMapper.queryBuyListEndByUsername(username);
    }

    @Override
    public List<BuyList> queryBuyListByGoods(String goods_name) {
        return buyListMapper.queryBuyListByGoods(goods_name);
    }

    @Override
    public int addBuyList(BuyList goods){
        return buyListMapper.addBuyList(goods);
    }

    @Override
    public int updateBuyList(BuyList goods){
        return buyListMapper.updateBuyList(goods);
    }

    @Override
    public int deleteBuyList(int id){
        return buyListMapper.deleteBuyList(id);
    }
}
